<template>
	<view class="body">
		<view class="page">
			<input type="number" v-model="money" class="inp" placeholder="¥ 请输入充值金额" maxlength="5">
			<view class="flex j-c a-c">
				<button class="js-image-a" type="default "
					style="margin: 20rpx;position: fixed; bottom: 100rpx;background-color: #0071FE;width: 600rpx;color: #fff;border-radius: 45rpx;"
					@tap="save()">
					<text class="p20">充值</text>
				</button>
			</view>
		</view>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				money: '',
			}
		},
		onShow() {
			let user = uni.getStorageSync('user')
			let fundsDTO = uni.getStorageSync('fundsDTO')
			if (user.itype == 1) {
				this.$module.showToast('用户禁止充值')
			} else {
				return
			}
		},
		methods: {
			save() {
				this.$module.showLoading('充值中')
				var that = this;
				let data = {
					data
				}
				let requestParams = {
					businessId: uni.getStorageSync('user').id,
					description: '商户充值',
					total: this.money, //e.充值金额
				};
				this.$module.sm(requestParams, 1, res => {
					data.data = res
				})
				this.Htpp.post('/mehrb/wxpay/payment', 'app', {
					datalist: data
				}).then(ret => {
					that.$module.sm(ret, 2, res => {
						that.$module.showToast('充值成功')
						setTimeout(that.$module.switchTab('pages/index/user_my'), 1600)
					})
				})
			},
		}
	}
</script>

<style lang="less" scoped>
	.body {
		height: 100vh;
		overflow: hidden;
		background-color: #eee;
	}

	.page {
		margin-top: 100rpx;

		.text {
			text-align: center;
			padding: 30rpx 0;
			margin: 0 10%;
			display: flex;
			justify-content: space-between;
		}

		.inp {
			background-color: #fff;
			width: 80%;
			height: 70rpx;
			margin: 0 auto;
			padding-left: 1em;
			font-weight: bold;
		}
	}
</style>